package com.volvo.caretrack.mobile.actions;

import java.util.Map;

import org.apache.commons.lang.StringUtils;
import com.volvo.caretrack.mobile.model.machine.MachinePosition;
import com.volvo.caretrack.mobile.services.MachineManagerService;
import com.volvo.caretrack.mobile.util.ParamUtil;

public class GetMachinePositionAction extends BaseAction {

	@Override
	public Object loadData(String sessionID, Map params) throws Exception {
		String chassisNo = ParamUtil.getParam(params, "chassisNo");
		MachinePosition position = null;
		if (StringUtils.isNotEmpty(chassisNo))
			position = MachineManagerService.getInstance().getMachinePosition(sessionID, chassisNo);
		return position;
	}

}
